var uid, ws, money;
document.addEventListener('plusready',function(){
	uid = plus.storage.getItem('uid');
	ws = plus.webview.currentWebview();
	showWating();
	$.ajax({
		type:"get",
		url:apiRoot+"?m=home&c=income&a=balance&uid="+uid,
		success :function(data){
			plus.nativeUI.closeWaiting();
			money = data;
			plus.storage.setItem('money', data+'');
			if(data)$('.balance').text(data+"元");
		},
		error :function(e){
			errortoast();
			console.log(JSON.stringify(e));
		}
	});
	//点击充值或者提现
	$('button').on('tap', function(){
		var _this = $(this).text();
		goNewPage('me-jf-withdraw-deposit-3.html',{title:_this, money:money})
	})
	//收入体现记录
	$('.mui-table-view-cell').on('tap', function(){
		var _this = $(this);
		var _index = _this.index();
		var _div = _this.find('div').text();
		goNewPage('me-jf-revenue-list.html',{title:_div})
	})
},false)
//改变余额
window.addEventListener('changeMoney', function(e){
	var money = e.detail.money;
	console.log(money);
	$('.balance').text(money+"元");
}, false)